﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Max.PH4.Shoppgin.Admin.Domain
{
    /// <summary>
    /// 
    /// </summary>
    [Table("tb_sku")]
    public class SKUEntity:AuditField
    {
        public Guid Id { get; set; }

        public Guid SPUId { get; set; }
        public string Specs { get; set; }   //{颜色：红色，内存：512M}

        /// <summary>
        /// 累计库存
        /// </summary>
        public int? Stock { get; set; }

        /// <summary>
        /// 可用库存
        /// </summary>
        public int? ValidStock { get; set; }

        /// <summary>
        /// 锁定库存
        /// </summary>
        public int? LockStock { get; set; }

        /// <summary>
        /// 销售价格
        /// </summary>
        public decimal? SalePrice { get; set; }

        /// <summary>
        /// 进货价格
        /// </summary>
        public decimal? InPrice { get; set; }

        /// <summary>
        /// 市场价格
        /// </summary>
        public decimal? MarketPrice { get; set; }

        /// <summary>
        /// 销售数量（已累计出售数量）
        /// </summary>
        public int? SaleNumber { get; set; }

        /// <summary>
        /// 标识字段（新品，特价，推荐。等等）
        /// </summary>
        public string? Flag { get; set; } = "00000000";

        /// <summary>
        /// 上架下架
        /// </summary>
        public bool? IsUp { get; set; } = true;


        /*
         * 乐观锁（时间戳）
         * 
         * **/
        [Timestamp]
        public byte[] TimeStamp { get; set; }
     }
}
